<script setup>
import {useStore} from "vuex";
import {mapMutations} from "vuex";
import {toRefs} from "vue";

const store = useStore()
let {name, age, address} = toRefs(store.state.userInfo)
const change=()=>{
store.commit("changeUserInfoMutation",1)
}
</script>

<template>
  <div class="layui-panel home">
    <h1>home组件</h1>
    <h1>userInfo的name:{{name}}</h1>
    <h1>userInfo的age:{{age}}</h1>
    <h1>userInfo的address:{{ address}}</h1>
    <button type="button" class="layui-btn" @click="change">从home组件中修改store中的userInfo</button>
  </div>
</template>

<style scoped lang="less"></style>